import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import autoImport from 'unplugin-auto-import/vite'
import vueComponents from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'

// https://vitejs.dev/config/
export default defineConfig({
  base: '/own-secret/',

  build: {
    outDir: 'website',
  },

  server: {
    host: true,
  },

  plugins: [
    vue(),
    vueComponents({
      dirs: [],
      dts: 'src/types/components.d.ts',
      resolvers: [ElementPlusResolver()],
    }),
    autoImport({
      dts: 'src/types/auto-imports.d.ts',
      imports: ['vue', '@vueuse/core'],
      resolvers: [ElementPlusResolver()],
    }),
  ],
})
